﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Hotel.ThongKe
{
    public partial class ReportThongKePhong : Form
    {
        string sophongsudung, sophongtrong, sophongsua, chiemphongsudung, chiemphongtrong, chiemphongsua;
        string ngaybegin, ngayend, tongluotdatphong;
        public ReportThongKePhong(string spsd, string spt, string sps, string cpsd, string cpt, string cps, string ngaybegin, string ngayend, string tong)
        {
            this.sophongsudung = spsd;
            this.sophongtrong = spt;
            this.sophongsua = sps;
            this.chiemphongsudung = cpsd;
            this.chiemphongtrong = cpt;
            this.chiemphongsua = cps;
            this.ngaybegin = ngaybegin;
            this.ngayend = ngayend;
            this.tongluotdatphong = tong;
            InitializeComponent();
        }

        private void ReportThongKePhong_Load(object sender, EventArgs e)
        {
            rptThongKePhong rpt = new rptThongKePhong();
            // thong ke theo ngay
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["sophongsudung"]).Text = sophongsudung;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["sophongtrong"]).Text = sophongtrong;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["sophongsua"]).Text = sophongsua;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["chiemphongsudung"]).Text = chiemphongsudung;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["chiemphongtrong"]).Text = chiemphongtrong;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["chiemphongsua"]).Text = chiemphongsua;
            // thong ke theo thoi gian
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["ngaybegin"]).Text = ngaybegin;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["ngayend"]).Text = ngayend;
            ((CrystalDecisions.CrystalReports.Engine.TextObject)rpt.ReportDefinition.ReportObjects["tongphongdat"]).Text = tongluotdatphong + "  Lượt";

            rpt.Refresh();
            this.rptViewThongKe.ReportSource = rpt;
        }
    }
}
